const navigateTo = (link) => {
    let evt = window.event || arguments.callee.caller.arguments[0];
    evt.preventDefault();
    if (parent && parent.navigateTo) {
        parent.navigateTo(link);
    } else {
        window.location.href = link;
    }
}
window.onload = function () {
    const links = document.querySelectorAll("a");
    links.forEach(a => {
        a.onclick = function () {
            navigateTo(a.href);
        };
    });
}